home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 5 / Apprentice-Release5.iso / Source Code / Libraries / DCLAP 6d / dclap6d / network / ncsasock / s_time.h < prev    next >
Text File  |  1996-07-05  |  2KB  |  76 lines

  1. /*
  2.  * Copyright (c) 1982, 1986 The Regents of the University of California.
  3.  * All rights reserved.
  4.  *
  5.  * Redistribution is only permitted until one year after the first shipment
  6.  * of 4.4BSD by the Regents.  Otherwise, redistribution and use in source and
  7.  * binary forms are permitted provided that: (1) source distributions retain
  8.  * this entire copyright notice and comment, and (2) distributions including
  9.  * binaries display the following acknowledgement:  This product includes
  10.  * software developed by the University of California, Berkeley and its
  11.  * contributors'' in the documentation or other materials provided with the
  12.  * distribution and in all advertising materials mentioning features or use
  13.  * of this software.  Neither the name of the University nor the names of
  14.  * its contributors may be used to endorse or promote products derived from
  15.  * this software without specific prior written permission.
  16.  * THIS SOFTWARE IS PROVIDED AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
  17.  * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
  18.  * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  19.  *
  20.  *    @(#)time.h    7.4 (Berkeley) 6/28/90
  21.  */
  22.  
  23. #ifndef _TIME_
  24. #define _TIME_
  25.  
  26. /*
  27.  * Structure returned by gettimeofday(2) system call,
  28.  * and used in other calls.
  29.  */
  30. struct timeval {
  31.     long    tv_sec;        /* seconds */
  32.     long    tv_usec;    /* and microseconds */
  33. };
  34.  
  35. struct timezone {
  36.     int    tz_minuteswest;    /* minutes west of Greenwich */
  37.     int    tz_dsttime;    /* type of dst correction */
  38. };
  39. #define    DST_NONE    0    /* not on dst */
  40. #define    DST_USA        1    /* USA style dst */
  41. #define    DST_AUST    2    /* Australian style dst */
  42. #define    DST_WET        3    /* Western European dst */
  43. #define    DST_MET        4    /* Middle European dst */
  44. #define    DST_EET        5    /* Eastern European dst */
  45. #define    DST_CAN        6    /* Canada */
  46.  
  47. /*
  48.  * Operations on timevals.
  49.  *
  50.  * NB: timercmp does not work for >= or <=.
  51.  */
  52. #define    timerisset(tvp)        ((tvp)->tv_sec || (tvp)->tv_usec)
  53. #define    timercmp(tvp, uvp, cmp)    \
  54.     ((tvp)->tv_sec cmp (uvp)->tv_sec || \
  55.      (tvp)->tv_sec == (uvp)->tv_sec && (tvp)->tv_usec cmp (uvp)->tv_usec)
  56. #define    timerclear(tvp)        (tvp)->tv_sec = (tvp)->tv_usec = 0
  57.  
  58. /*
  59.  * Names of the interval timers, and structure
  60.  * defining a timer setting.
  61.  */
  62. #define    ITIMER_REAL    0
  63. #define    ITIMER_VIRTUAL    1
  64. #define    ITIMER_PROF    2
  65.  
  66. struct    itimerval {
  67.     struct    timeval it_interval;    /* timer interval */
  68.     struct    timeval it_value;    /* current value */
  69. };
  70.  
  71. #ifndef KERNEL
  72. #include <time.h>
  73. #endif
  74.  
  75. #endif /* _TIME_ */
  76.